# -*- coding: utf-8 -*-		
# @Time    : 2024/12/28 23:24		
# @Author  : 郑旬澔		
# @FileName: fangjia.py		
# @Software: PyCharm		
from abc import ABC, abstractmethod

# 抽象类 User
class User(ABC):
    def __init__(self, name: str):
        self.name = name

    @abstractmethod
    def calculate_price(self, base_price: float) -> float:
        pass

# 普通用户
class RegularUser(User):
    def calculate_price(self, base_price: float) -> float:
        return base_price

# 金卡用户
class GoldUser(User):
    def calculate_price(self, base_price: float) -> float:
        return base_price * 0.8

# 银卡用户
class SilverUser(User):
    def calculate_price(self, base_price: float) -> float:
        return base_price * 0.9

# 示例测试代码
if __name__ == "__main__":
    base_price = 1000.0
    users = [
        RegularUser("Alice"),
        GoldUser("Bob"),
        SilverUser("Charlie")
    ]

    for user in users:
        print(f"{user.name}: 房价为 {user.calculate_price(base_price)}")
